//
// Source code recreated from a .class file by IntelliJ IDEA
// (powered by FernFlower decompiler)
//

package com.allchips.pin.util;

public class BaseResp extends BaseEntity {
    private Integer code;
    private String message;

    public BaseResp() {
        this.code = RestAPICode.NORMAL.getCode();
        this.message = RestAPICode.NORMAL.getMessage();
    }

    public BaseResp(Integer code, String message) {
        this.code = code;
        this.message = message;
    }

    public BaseResp(String message) {
        this();
        this.message = message;
    }

    public BaseResp(String message, int code) {
        this.message = message;
        this.code = code;
    }

    public BaseResp(RestAPICode code) {
        this.message = code.getMessage();
        this.code = code.getCode();
    }

    public void setMessage4ParamError(String message) {
        this.code = RestAPICode.REQUEST_PARAM_FIELD_ERROR.getCode();
        this.message = message;
    }

    public void setMessage4JsonParamError(String message) {
        this.code = RestAPICode.REQUEST_JSON_FIELD_ERROR.getCode();
        this.message = message;
    }

    public void setRestAPICode(RestAPICode code) {
        this.message = code.getMessage();
        this.code = code.getCode();
    }

    public void setErrorCode(RestAPICode code) {
        this.setRestAPICode(code);
    }

    public Integer getCode() {
        return this.code;
    }

    public void setCode(Integer code) {
        this.code = code;
    }

    public String getMessage() {
        return this.message;
    }

    public void setMessage(String message) {
        this.message = message;
    }
}
